<template>
  <div class="searchmodle">
    <el-input class="searcinput"
              :placeholder="placeholder"
              v-model="words"
              @keyup.enter.native="seacher"
              :clearable="true"
    ></el-input>
    <el-button type="primary" icon="el-icon-search" @click.native="seacher">搜索</el-button>
  </div>
</template>

<script>
  // import { exportlist } from '../api/statecmp.js'
  // import { dynExport } from '../api/statecmp.js'
  // import { mapGetters } from 'vuex'
  // import { getToken } from '@/utils/auth'
  // import { initData, download } from '@/api/data'
  // import { parseTime, downloadFile } from '@/utils/index'

  export default {
    // props: {
    //   pagedata: {
    //     type: Object,
    //     default: {} ,
    //   },

    // },
    props: ['placeholder', 'keyWords'],
    // dicts: ['construction_type','board', 'soil_gauge', 'state','bidding_type'],
    data() {
      return {
        words: ''
      };
    },
    watch: {
      words() {
        if (this.words.trim() === "") {
          this.seacher();
        }
      }
    },
      methods: {
        seacher() {
          this.$emit('seacherKey', this.words.trim())
        }
      },
    };
</script>

<style>
  .searcinput input {
    height: 34px;
    line-height: 34px;
  }

  .searchmodle {
    display: flex;
    display: -webkit-inline-flex;
    align-items: center;
    align-content: center;
  }
</style>
